package org.common.dynamicbean;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;


public interface DynamicPropertySet extends Serializable, Iterable<DynamicProperty>
{
    Class getType( String name );
    <T> T  getValue(String name);

    void setValue( String name, Object value );

    DynamicProperty getProperty( String name );

    void add( DynamicProperty property );
    
    public int count();
    public boolean isEmpty();

 
    boolean contains( DynamicProperty property );
    boolean remove( String name );

    boolean replaceWith( String name, DynamicProperty prop );

    Iterator<String> nameIterator();

    Map asMap();

    void addPropertyChangeListener( PropertyChangeListener listener );
    void addPropertyChangeListener( String propertyName, PropertyChangeListener listener );
    void removePropertyChangeListener( PropertyChangeListener listener );
    void removePropertyChangeListener( String propertyName, PropertyChangeListener listener );
    void firePropertyChange( String propertyName, Object oldValue, Object newValue );
    void firePropertyChange( PropertyChangeEvent evt );
    boolean hasListeners( String propertyName );
}

